/**
* Created by Administrator on 2025/5/9.
* */
#include "AppDelegate.h"
#include "GlobalParameters.h"
#include <string>
#include "DataReplayer/DataReplayer.h"
#include "EthernetReader.h"
#include "EthernetWriter.h"

void AppDelegate::onConfigure(device_config_t *config){
    config->calculationPoolSize=8;
    config->globalParametersInstance = GlobalParameters::shareInstance();
    config->deviceId=13;
    config->servicePort=55261;
    config->ip="192.168.1.115";
    config->userVersion="1.0";
}

void AppDelegate::onStart(){
    REGISTER_RUNTIME_LOADED_CLASSES(DataReplayer);
    auto dataReplayer = new DataReplayer();

    auto radarlabReader = new EthernetReader(TCP,6666);
    radarlabReader->addTaskModule(dataReplayer,0,1024);

    auto radarlabWriter = new EthernetWriter(TCP,"192.168.1.115",6692,true);
    dataReplayer->addDeviceWriter(0,radarlabWriter,1024);
    REGISTER_INSTANCES(dataReplayer,radarlabReader,radarlabWriter);
}
